<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for functions.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file functions.php</h1>
<p>Documentation is available at <a href="../psa/_scripts---functions.php.html">functions.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;PSA&nbsp;functions.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;LICENSE:</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;See&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;along&nbsp;with&nbsp;This&nbsp;library.&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;</span><span class="src-doc-inlinetag">{@link&nbsp;http://www.gnu.org/licenses/}</span><span class="src-doc">&gt;.</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://code.google.com/p/phpstartapp/</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;&lt;bmauser@gmail.com&gt;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;2009</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;psa</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;$Id:&nbsp;functions.php&nbsp;464&nbsp;2009-03-24&nbsp;00:30:12Z&nbsp;bmauser&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a26"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*&nbsp;Deletes&nbsp;user&nbsp;or&nbsp;group.&nbsp;Removes&nbsp;all&nbsp;data&nbsp;about&nbsp;the&nbsp;user&nbsp;or&nbsp;group&nbsp;from&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;Do&nbsp;not&nbsp;use&nbsp;this&nbsp;function&nbsp;directly.&nbsp;Use&nbsp;psa_group_del()&nbsp;and&nbsp;psa_user_del()&nbsp;wrapper&nbsp;functions.</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">array</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc-var">$id&nbsp;</span><span class="src-doc">id&nbsp;of&nbsp;the&nbsp;user|group&nbsp;or&nbsp;array&nbsp;with&nbsp;user|group&nbsp;ids.&nbsp;'all'&nbsp;for</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;deleting&nbsp;all&nbsp;users|groups.</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc-var">$user_or_group&nbsp;</span><span class="src-doc">what&nbsp;to&nbsp;delete.&nbsp;1-user,&nbsp;2-group</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1&nbsp;user|group&nbsp;(or&nbsp;more&nbsp;users|groups)&nbsp;not&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;psa_group_del()</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;psa_user_del()</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-key">function&nbsp;</span><span class="src-id">psa_del_user_group</span><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">,</span><span class="src-var">$user_or_group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a42"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$id&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$user_or_group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;database&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;$id&nbsp;is&nbsp;not&nbsp;array&nbsp;make&nbsp;it&nbsp;array&nbsp;for&nbsp;foreach&nbsp;loop</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$id&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;flag&nbsp;if&nbsp;some&nbsp;query&nbsp;fail&nbsp;in&nbsp;the&nbsp;foreach&nbsp;loop</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$failed&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;work&nbsp;with&nbsp;users</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a59"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$table&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'user'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a60"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$name_column&nbsp;</span>=&nbsp;<span class="src-str">'psa_username'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_to_run_before&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin_Before_User_Delete'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_to_run_after&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin_After_User_Delete'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;work&nbsp;with&nbsp;groups</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$table&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'group'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$name_column&nbsp;</span>=&nbsp;<span class="src-str">'psa_name'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_to_run_before&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin_Before_Group_Delete'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_to_run_after&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin_After_Group_Delete'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;delete&nbsp;users&nbsp;or&nbsp;groups</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$id&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$id_key&nbsp;</span>=&gt;&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$id_value</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;delete&nbsp;all&nbsp;users&nbsp;or&nbsp;groups</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$id_value&nbsp;</span>==&nbsp;<span class="src-str">'all'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">DELETE&nbsp;FROM&nbsp;{<span class="src-var">$table</span><span class="src-sym">}</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;delete&nbsp;user&nbsp;or&nbsp;groups&nbsp;by&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">DELETE&nbsp;FROM&nbsp;{<span class="src-var">$table</span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;psa_id&nbsp;=&nbsp;'<span class="src-var">$id_value</span>'</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;delete&nbsp;user&nbsp;or&nbsp;groups&nbsp;by&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">DELETE&nbsp;FROM&nbsp;{<span class="src-var">$table</span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;<span class="src-var">$name_column</span>&nbsp;=&nbsp;</span><span class="src-str">&quot;&nbsp;</span>.&nbsp;<span class="src-var">$psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">escape</span><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;Psa_Plugin_Before_[user/group]_Delete&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../psa/_scripts---functions.php.html#functionpsa_run_plugins">psa_run_plugins</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$plugins_to_run_before&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'psa_main'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">)))</span><span class="src-sym">,</span><span class="src-str">'by_type'</span><span class="src-sym">,</span><span class="src-str">'no_unregistered_warning'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;query&nbsp;against&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;no&nbsp;rows&nbsp;affected</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">affected_rows</span><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>&lt;=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$failed&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">]&nbsp;&nbsp;</span>=&nbsp;<span class="src-str">'Unable&nbsp;to&nbsp;delete&nbsp;'&nbsp;</span>.&nbsp;<span class="src-sym">((</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-str">'user'&nbsp;</span>:&nbsp;<span class="src-str">'group'</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">&quot;.&nbsp;Maybe&nbsp;does&nbsp;not&nbsp;exists.&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;run&nbsp;Psa_Plugin_After_[user/group]_Delete&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../psa/_scripts---functions.php.html#functionpsa_run_plugins">psa_run_plugins</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$plugins_to_run_after&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'psa_main'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">)))</span><span class="src-sym">,</span><span class="src-str">'by_type'</span><span class="src-sym">,</span><span class="src-str">'no_unregistered_warning'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'message'</span><span class="src-sym">]&nbsp;&nbsp;</span>=&nbsp;<span class="src-sym">((</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-str">'User'&nbsp;</span>:&nbsp;<span class="src-str">'Group'</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;deleted'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;logging</span></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'logging'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'max_log_level'</span><span class="src-sym">]&nbsp;</span>&gt;=&nbsp;<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parameters&nbsp;for&nbsp;Psa_Logger::log()&nbsp;method</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'function'</span><span class="src-sym">]&nbsp;</span>=&nbsp;__FUNCTION__<span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'level'</span><span class="src-sym">]&nbsp;&nbsp;&nbsp;&nbsp;</span>=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'user_id'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$id_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$id_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user_or_group&nbsp;</span>==&nbsp;<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_int">is_int</a><span class="src-sym">(</span><span class="src-var">$id_value</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'group_id'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$id_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'groupname'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$id_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../psa/Psa_Logger.html">Psa_Logger</a></span><span class="src-sym">::</span><a href="../psa/Psa_Logger.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><a href="http://www.php.net/log">log</a><span class="src-sym">(</span><span class="src-var">$log_data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$failed</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a133"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a136"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-doc">&nbsp;*&nbsp;Deletes&nbsp;user.&nbsp;Removes&nbsp;all&nbsp;data&nbsp;about&nbsp;the&nbsp;user&nbsp;from&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;delete&nbsp;user&nbsp;by&nbsp;id&nbsp;be&nbsp;sure&nbsp;to&nbsp;pass&nbsp;integer&nbsp;as&nbsp;argument&nbsp;(or&nbsp;array&nbsp;of&nbsp;integers)</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-doc">&nbsp;*&nbsp;and&nbsp;use&nbsp;cast&nbsp;operator&nbsp;&lt;kbd&gt;(int)&lt;/kbd&gt;</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-internal">{@internal&nbsp;This&nbsp;is&nbsp;a&nbsp;wrapper&nbsp;function&nbsp;for&nbsp;psa_del_user_group()}}</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc-internal">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">array</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc-var">$user&nbsp;</span><span class="src-doc">ID&nbsp;or&nbsp;username&nbsp;of&nbsp;the&nbsp;user&nbsp;or&nbsp;array&nbsp;with&nbsp;user</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;ids&nbsp;or&nbsp;usernames.&nbsp;&lt;kbd&gt;all&lt;/kbd&gt;&nbsp;to&nbsp;delete&nbsp;all&nbsp;users.</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1&nbsp;user&nbsp;(or&nbsp;more&nbsp;users)&nbsp;not&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a145"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;</span><span class="src-doc-internal">{@internal&nbsp;@see&nbsp;psa_del_user_group()}}</span></div></li>
<li><div class="src-line"><a name="a146"></a><span class="src-doc-internal">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a147"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_user_del">psa_user_del</a><span class="src-sym">(</span><span class="src-var">$user</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">psa_del_user_group</span><span class="src-sym">(</span><span class="src-var">$user</span><span class="src-sym">,</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a152"></a><span class="src-doc-internal">/**</span></div></li>
<li><div class="src-line"><a name="a153"></a><span class="src-doc-internal">&nbsp;*&nbsp;Deletes&nbsp;group.&nbsp;Removes&nbsp;all&nbsp;data&nbsp;about&nbsp;the&nbsp;group&nbsp;from&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-doc-internal">&nbsp;*&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;delete&nbsp;group&nbsp;by&nbsp;id&nbsp;be&nbsp;sure&nbsp;to&nbsp;pass&nbsp;integer&nbsp;as&nbsp;argument&nbsp;(or&nbsp;array&nbsp;of&nbsp;integers)</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-doc-internal">&nbsp;*&nbsp;and&nbsp;use&nbsp;cast&nbsp;operator&nbsp;&lt;kbd&gt;(int)&lt;/kbd&gt;</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-doc-internal">&nbsp;*&nbsp;{@internal&nbsp;This&nbsp;is&nbsp;a&nbsp;wrapper&nbsp;function&nbsp;for&nbsp;psa_del_user_group()}}</span><span class="src-doc">}</span></div></li>
<li><div class="src-line"><a name="a157"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int</span><span class="src-doc">|</span><span class="src-doc-type">array</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc-var">$group&nbsp;</span><span class="src-doc">ID&nbsp;or&nbsp;name&nbsp;of&nbsp;the&nbsp;group&nbsp;or&nbsp;array&nbsp;with&nbsp;group&nbsp;ids&nbsp;or&nbsp;group&nbsp;names.</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;kbd&gt;all&lt;/kbd&gt;&nbsp;to&nbsp;delete&nbsp;all&nbsp;groups.</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">0&nbsp;for&nbsp;failure,&nbsp;1&nbsp;for&nbsp;success,&nbsp;-1&nbsp;group&nbsp;(or&nbsp;more&nbsp;groups)&nbsp;not&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;</span><span class="src-doc-internal">{@internal&nbsp;@see&nbsp;psa_del_user_group()}}</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc-internal">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_group_del">psa_group_del</a><span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">psa_del_user_group</span><span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a165"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-doc-internal">/**</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-doc-internal">&nbsp;*&nbsp;Calls&nbsp;&lt;kbd&gt;debug_backtrace()&lt;/kbd&gt;&nbsp;PHP&nbsp;function&nbsp;and&nbsp;returns&nbsp;formatted&nbsp;backtrace&nbsp;string.</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-doc-internal">&nbsp;*&nbsp;It&nbsp;is&nbsp;used&nbsp;for&nbsp;logs.</span></div></li>
<li><div class="src-line"><a name="a171"></a><span class="src-doc-internal">&nbsp;*&nbsp;Example&nbsp;of&nbsp;returned&nbsp;string:&lt;pre&gt;</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-doc-internal">&nbsp;*&nbsp;query()&nbsp;called&nbsp;at&nbsp;[/WEBROOT/bf/psa/scripts/Psa_User.class.php:391]</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-doc-internal">&nbsp;*&nbsp;add_remove_group()&nbsp;called&nbsp;at&nbsp;[/WEBROOT/bf/psa/scripts/Psa_User.class.php:327]</span></div></li>
<li><div class="src-line"><a name="a174"></a><span class="src-doc-internal">&nbsp;*&nbsp;add_group()&nbsp;called&nbsp;at&nbsp;[/WEBROOT/bf/index.php:17]</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-doc-internal">&nbsp;*&nbsp;&lt;/pre&gt;</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-doc-internal">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_get_backtrace">psa_get_backtrace</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;backtrace&nbsp;info</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$backtrace&nbsp;</span>=&nbsp;<a href="http://www.php.net/debug_backtrace">debug_backtrace</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$backtrace_str&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$backtrace&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$backtrace_key&nbsp;</span>=&gt;&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$backtrace_value</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;skip&nbsp;the&nbsp;first&nbsp;one,&nbsp;since&nbsp;it's&nbsp;always&nbsp;this&nbsp;function</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$backtrace_key&nbsp;</span>==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$backtrace_str&nbsp;</span>.=&nbsp;<span class="src-var">$backtrace_value</span><span class="src-sym">[</span><span class="src-str">'function'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'()'&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;called&nbsp;at&nbsp;['&nbsp;</span>.&nbsp;&nbsp;<a href="http://www.php.net/str_replace">str_replace</a>&nbsp;<span class="src-sym">(</span><span class="src-str">&quot;\\&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/'</span><span class="src-sym">,&nbsp;</span><span class="src-sym">@</span><span class="src-var">$backtrace_value</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">':'&nbsp;</span>.&nbsp;<span class="src-sym">@</span><span class="src-var">$backtrace_value</span><span class="src-sym">[</span><span class="src-str">'line'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">&quot;]\r\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$backtrace_str</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a199"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a202"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a203"></a><span class="src-doc">&nbsp;*&nbsp;Calls&nbsp;plugin&nbsp;methods.&nbsp;Executes&nbsp;(runs)&nbsp;plugins.</span></div></li>
<li><div class="src-line"><a name="a204"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;function&nbsp;includes&nbsp;plugin&nbsp;files,&nbsp;makes&nbsp;new&nbsp;instances&nbsp;of&nbsp;plugin&nbsp;objects&nbsp;named&nbsp;like&nbsp;plugin&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a205"></a><span class="src-doc">&nbsp;*&nbsp;and&nbsp;calls&nbsp;member&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc">&nbsp;*&nbsp;It&nbsp;can&nbsp;call&nbsp;plugin's&nbsp;methods&nbsp;in&nbsp;two&nbsp;different&nbsp;ways&nbsp;depending&nbsp;on&nbsp;second&nbsp;argument.</span></div></li>
<li><div class="src-line"><a name="a207"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;the&nbsp;second&nbsp;argument&nbsp;is&nbsp;false&nbsp;(default)&nbsp;plugins&nbsp;are&nbsp;called&nbsp;&lt;i&gt;by&nbsp;id&lt;/i&gt;&nbsp;(plugin&nbsp;id&nbsp;is&nbsp;same</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc">&nbsp;*&nbsp;as&nbsp;plugin&nbsp;class&nbsp;name)&nbsp;and&nbsp;in&nbsp;this&nbsp;case&nbsp;first&nbsp;argument&nbsp;should&nbsp;be&nbsp;array&nbsp;with&nbsp;elements</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc">&nbsp;*&nbsp;like&nbsp;in&nbsp;this&nbsp;example:</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;$run&nbsp;is&nbsp;array&nbsp;that&nbsp;will&nbsp;be&nbsp;argument&nbsp;for&nbsp;psa_run_plugins()&nbsp;function</span></div></li>
<li><div class="src-line"><a name="a212"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;Structure&nbsp;should&nbsp;be:&nbsp;$run['plugin_id']['plugin_method']&nbsp;=&nbsp;array('method_argument1','method_argument2',...);</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-doc">&nbsp;*&nbsp;$run['Article']['load']&nbsp;=&nbsp;array(14);</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-doc">&nbsp;*&nbsp;$run['News']['open']&nbsp;=&nbsp;array();</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-doc">&nbsp;*&nbsp;psa_run_plugins($run);</span></div></li>
<li><div class="src-line"><a name="a216"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;example&nbsp;calls&nbsp;method&nbsp;&lt;kbd&gt;load&lt;/kbd&gt;&nbsp;with&nbsp;one&nbsp;argument&nbsp;(14)&nbsp;from&nbsp;the&nbsp;&lt;kbd&gt;Article&lt;/kbd&gt;&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-doc">&nbsp;*&nbsp;(plugin)&nbsp;instanced&nbsp;as&nbsp;object&nbsp;named&nbsp;&lt;kbd&gt;Article&lt;/kbd&gt;&nbsp;and&nbsp;method&nbsp;&lt;kbd&gt;open&lt;/kbd&gt;&nbsp;with&nbsp;no&nbsp;arguments</span></div></li>
<li><div class="src-line"><a name="a219"></a><span class="src-doc">&nbsp;*&nbsp;from&nbsp;the&nbsp;&lt;kbd&gt;News&lt;/kbd&gt;&nbsp;class&nbsp;instanced&nbsp;as&nbsp;object&nbsp;named&nbsp;&lt;kbd&gt;News&lt;/kbd&gt;.</span></div></li>
<li><div class="src-line"><a name="a220"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a221"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;the&nbsp;second&nbsp;argument&nbsp;is&nbsp;true&nbsp;plugins&nbsp;are&nbsp;called&nbsp;&lt;i&gt;by&nbsp;type&lt;/i&gt;&nbsp;and&nbsp;in&nbsp;this&nbsp;case&nbsp;first&nbsp;argument</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-doc">&nbsp;*&nbsp;should&nbsp;be&nbsp;an&nbsp;array&nbsp;with&nbsp;elements&nbsp;like&nbsp;in&nbsp;example&nbsp;below:</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;$run&nbsp;is&nbsp;array&nbsp;that&nbsp;will&nbsp;be&nbsp;argument&nbsp;for&nbsp;psa_run_plugins()&nbsp;function</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc">&nbsp;*&nbsp;//&nbsp;Structure&nbsp;should&nbsp;be:&nbsp;$run['plugin_type']['plugin_method']&nbsp;=&nbsp;array('method_argument1','method_argument2',...);</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc">&nbsp;*&nbsp;$run['Psa_Plugin_Before_User_Delete']['psa_main']&nbsp;=&nbsp;array(177);</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-doc">&nbsp;*&nbsp;psa_run_plugins($run,'by_type');</span></div></li>
<li><div class="src-line"><a name="a228"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a229"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;example&nbsp;calls&nbsp;method&nbsp;&lt;kbd&gt;psa_main&lt;/kbd&gt;&nbsp;with&nbsp;one&nbsp;argument&nbsp;(177)&nbsp;from&nbsp;all&nbsp;registered&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a230"></a><span class="src-doc">&nbsp;*&nbsp;of&nbsp;type&nbsp;&lt;kbd&gt;Psa_Plugin_Before_User_Delete&lt;/kbd&gt;.</span></div></li>
<li><div class="src-line"><a name="a231"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a232"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;function&nbsp;will&nbsp;throw&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Exception}</span><span class="src-doc">&nbsp;on&nbsp;error.</span></div></li>
<li><div class="src-line"><a name="a233"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a234"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$run_details&nbsp;</span><span class="src-doc">array&nbsp;with&nbsp;details&nbsp;what&nbsp;to&nbsp;run</span></div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$by_type&nbsp;</span><span class="src-doc">if&nbsp;true&nbsp;plugins&nbsp;will&nbsp;be&nbsp;called&nbsp;&lt;i&gt;by&nbsp;type&lt;/i&gt;&nbsp;otherwise&nbsp;will&nbsp;be&nbsp;called&nbsp;&lt;i&gt;by&nbsp;id&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a236"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$disable_unregistered_exception&nbsp;</span><span class="src-doc">exception&nbsp;that&nbsp;plugin&nbsp;is&nbsp;not&nbsp;registered&nbsp;will&nbsp;not&nbsp;be&nbsp;thrown.</span></div></li>
<li><div class="src-line"><a name="a237"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;This&nbsp;parameter&nbsp;can&nbsp;be&nbsp;set&nbsp;to&nbsp;true&nbsp;when&nbsp;plugin&nbsp;doesn't&nbsp;have&nbsp;to&nbsp;be&nbsp;registered&nbsp;like</span></div></li>
<li><div class="src-line"><a name="a238"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Plugin_After_User_Create}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a239"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">1:success&nbsp;all&nbsp;plugins&nbsp;executed,&nbsp;-1:success,&nbsp;but&nbsp;not&nbsp;with&nbsp;all&nbsp;plugins&nbsp;because&nbsp;some&nbsp;are</span></div></li>
<li><div class="src-line"><a name="a240"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;probably&nbsp;not&nbsp;registered.&nbsp;-1&nbsp;can&nbsp;be&nbsp;returned&nbsp;only&nbsp;when&nbsp;third&nbsp;argument&nbsp;is&nbsp;set&nbsp;to&nbsp;true&nbsp;otherwise</span></div></li>
<li><div class="src-line"><a name="a241"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;exception&nbsp;will&nbsp;be&nbsp;thrown.</span></div></li>
<li><div class="src-line"><a name="a242"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;Some&nbsp;are&nbsp;probably&nbsp;not&nbsp;registered.&nbsp;See&nbsp;log&nbsp;for&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a243"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Plugin::register()</span></div></li>
<li><div class="src-line"><a name="a244"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;Psa_Exception</span></div></li>
<li><div class="src-line"><a name="a245"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a246"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_run_plugins">psa_run_plugins</a><span class="src-sym">(</span><span class="src-var">$run_details</span><span class="src-sym">,&nbsp;</span><span class="src-var">$by_type&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">,&nbsp;</span><span class="src-var">$disable_unregistered_exception&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;request&nbsp;id&nbsp;for&nbsp;profile&nbsp;logging</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-var">$request_id&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;plugin&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_plugins&nbsp;</span>=&nbsp;<span class="src-id">Psa_Plugin</span><span class="src-sym">::</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;router&nbsp;plugin&nbsp;is&nbsp;called&nbsp;make&nbsp;exception&nbsp;and&nbsp;allow&nbsp;executing&nbsp;without&nbsp;any&nbsp;registered&nbsp;plugin&nbsp;because</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;router&nbsp;is&nbsp;called&nbsp;first&nbsp;and&nbsp;should&nbsp;be&nbsp;called&nbsp;without&nbsp;reading&nbsp;data&nbsp;about&nbsp;plugins&nbsp;from&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data&nbsp;</span>&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$run_details</span><span class="src-sym">[</span><span class="src-str">'Router'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'psa_main'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'router_location'</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_data_temp</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'Router'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'basedir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'router_location'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-str">'Router.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_data_temp</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'Router'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'basedir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-str">'Router.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_data_temp</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'Router'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin_Router'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_plugins__plugins_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$plugins_data_temp</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a271"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;reference&nbsp;to&nbsp;$psa_plugins-&gt;plugins_data&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_plugins__plugins_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;die&nbsp;if&nbsp;plugin&nbsp;are&nbsp;not&nbsp;registered&nbsp;or&nbsp;not&nbsp;retrieved&nbsp;from&nbsp;session&nbsp;or&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$psa_plugins__plugins_data&nbsp;</span><span class="src-key">or&nbsp;</span><span class="src-sym">!</span><span class="src-id">is_array</span><span class="src-sym">(</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-str">'Psa_Fatal_Error_Exception.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$msg&nbsp;</span>=&nbsp;<span class="src-str">'No&nbsp;plugins&nbsp;to&nbsp;run.&nbsp;Plugins&nbsp;are&nbsp;not&nbsp;registered&nbsp;or&nbsp;data&nbsp;not&nbsp;retrieved&nbsp;from&nbsp;session&nbsp;or&nbsp;database'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a278"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/exceptions/Psa_Fatal_Error_Exception.html">Psa_Fatal_Error_Exception</a></span><span class="src-sym">(</span><span class="src-var">$msg</span><span class="src-sym">,&nbsp;</span><span class="src-var">$msg</span><span class="src-sym">,&nbsp;</span><span class="src-num">16</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a279"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a280"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a281"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a282"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;exit&nbsp;if&nbsp;$run_details&nbsp;is&nbsp;not&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a283"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$run_details</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-str">'Psa_Exception.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/exceptions/Psa_Exception.html">Psa_Exception</a></span><span class="src-sym">(</span><span class="src-str">'Invalid&nbsp;first&nbsp;argument&nbsp;for&nbsp;psa_run_plugins()&nbsp;function.&nbsp;Not&nbsp;array.'</span><span class="src-sym">,&nbsp;</span><span class="src-num">11</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;call&nbsp;all&nbsp;plugins&nbsp;of&nbsp;same&nbsp;type</span></div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$by_type</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugin_type&nbsp;</span>=&nbsp;<a href="http://www.php.net/key">key</a><span class="src-sym">(</span><span class="src-var">$run_details</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;plugin&nbsp;is&nbsp;registered</span></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-var">$plugin_type</span><span class="src-sym">]</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-var">$plugin_type</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$disable_unregistered_exception</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-str">'Psa_Exception.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/exceptions/Psa_Exception.html">Psa_Exception</a></span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Trying&nbsp;to&nbsp;run&nbsp;unregistered&nbsp;plugin&nbsp;type&nbsp;of&nbsp;<span class="src-var">$plugin_type</span>.&nbsp;Try&nbsp;to&nbsp;register&nbsp;plugins&nbsp;and&nbsp;delete&nbsp;session&nbsp;(cookies)&nbsp;if&nbsp;you&nbsp;store&nbsp;registered&nbsp;plugin&nbsp;data&nbsp;in&nbsp;session.</span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-num">12</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span></div></li>
<li><div class="src-line"><a name="a303"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a304"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a306"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;call&nbsp;plugins&nbsp;by&nbsp;id&nbsp;(plugin&nbsp;class&nbsp;name)</span></div></li>
<li><div class="src-line"><a name="a307"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a308"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugins_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$run_details</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a310"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a311"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a312"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;set&nbsp;default&nbsp;return&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a313"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$plugins_data&nbsp;is&nbsp;array&nbsp;with&nbsp;data&nbsp;used&nbsp;to&nbsp;instance&nbsp;classes&nbsp;and&nbsp;run&nbsp;methods&nbsp;(class&nbsp;name,&nbsp;method&nbsp;name,&nbsp;file&nbsp;name)</span></div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$plugins_data&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$plugins_data_key&nbsp;</span>=&gt;&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$plugins_data_value</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a318"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;call&nbsp;all&nbsp;plugins&nbsp;of&nbsp;same&nbsp;type</span></div></li>
<li><div class="src-line"><a name="a320"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$by_type</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a321"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$include_file&nbsp;</span>=&nbsp;<span class="src-var">$plugins_data_value</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a322"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugin_class&nbsp;</span>=&nbsp;<span class="src-var">$plugins_data_key</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a323"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugin_methods_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$run_details</span><span class="src-sym">[</span><span class="src-var">$plugin_type</span><span class="src-sym">]</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;array&nbsp;of&nbsp;method&nbsp;names&nbsp;and&nbsp;arguments</span></div></li>
<li><div class="src-line"><a name="a324"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a325"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;we&nbsp;call&nbsp;plugins&nbsp;by&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a326"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a327"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a328"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;plugin&nbsp;is&nbsp;not&nbsp;registered</span></div></li>
<li><div class="src-line"><a name="a329"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$plugins_data_key</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$disable_unregistered_exception</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-str">'Psa_Exception.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/exceptions/Psa_Exception.html">Psa_Exception</a></span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Trying&nbsp;to&nbsp;run&nbsp;unregistered&nbsp;plugin&nbsp;<span class="src-var">$plugins_data_key</span>.&nbsp;Try&nbsp;to&nbsp;register&nbsp;plugins&nbsp;and&nbsp;delete&nbsp;session&nbsp;(cookies)&nbsp;if&nbsp;you&nbsp;store&nbsp;registered&nbsp;plugin&nbsp;data&nbsp;in&nbsp;session.</span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-num">13</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return&nbsp;</span>=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a339"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a341"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$include_file&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$plugins_data_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugin_class&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$plugins_data_key</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$plugin_methods_data&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$plugins_data_value</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;array&nbsp;of&nbsp;method&nbsp;names&nbsp;and&nbsp;arguments</span></div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;include&nbsp;plugin&nbsp;file</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">require_once&nbsp;</span><span class="src-var">$include_file</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a349"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;plugin&nbsp;object&nbsp;is&nbsp;already&nbsp;instanced</span></div></li>
<li><div class="src-line"><a name="a351"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span>$<span class="src-var">$plugin_class</span><span class="src-sym">))</span><span class="src-sym">{&nbsp;</span><span class="src-comm">//!is_object&nbsp;(@$$plugin_class)</span></div></li>
<li><div class="src-line"><a name="a352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a353"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;TODO:&nbsp;check&nbsp;if&nbsp;we&nbsp;have&nbsp;arguments&nbsp;for&nbsp;__construct&nbsp;method&nbsp;</span></div></li>
<li><div class="src-line"><a name="a354"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;instance&nbsp;of&nbsp;plugin&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$<span class="src-var">$plugin_class&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-var">$plugin_class</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a357"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;call&nbsp;plugin&nbsp;object&nbsp;methods</span></div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$plugin_methods_data</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a361"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a362"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$plugin_methods_data&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$plugin_method_name&nbsp;</span>=&gt;&nbsp;<span class="src-var">$plugin_method_args</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a363"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a364"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;method&nbsp;exists</span></div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/method_exists">method_exists</a><span class="src-sym">(</span>$<span class="src-var">$plugin_class</span><span class="src-sym">,&nbsp;</span><span class="src-var">$plugin_method_name</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a366"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a367"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;I&nbsp;couldn't&nbsp;use&nbsp;call_user_func_array()&nbsp;here&nbsp;because&nbsp;it&nbsp;is&nbsp;suitable&nbsp;only&nbsp;for&nbsp;static&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a368"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;So&nbsp;i&nbsp;use&nbsp;PHP&nbsp;reflection&nbsp;api&nbsp;to&nbsp;invoke&nbsp;method&nbsp;with&nbsp;array&nbsp;of&nbsp;arguments.</span></div></li>
<li><div class="src-line"><a name="a369"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Also&nbsp;here&nbsp;can&nbsp;eval()&nbsp;be&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a370"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Simplest&nbsp;and&nbsp;the&nbsp;fastest&nbsp;solution&nbsp;would&nbsp;be:&nbsp;$$plugin_class_name-&gt;$plugin_method_name($plugin_method_args);</span></div></li>
<li><div class="src-line"><a name="a371"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;but&nbsp;then&nbsp;invoking&nbsp;method&nbsp;must&nbsp;be&nbsp;written&nbsp;to&nbsp;accept&nbsp;one&nbsp;parameter&nbsp;which&nbsp;is&nbsp;array&nbsp;with&nbsp;values&nbsp;that</span></div></li>
<li><div class="src-line"><a name="a372"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;normally&nbsp;would&nbsp;be&nbsp;separate&nbsp;method&nbsp;parameters.&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a373"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a374"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;create&nbsp;an&nbsp;instance&nbsp;of&nbsp;the&nbsp;Reflection_Method&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a375"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$invoke_method&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">ReflectionMethod</span><span class="src-sym">(</span><span class="src-var">$plugin_class</span><span class="src-sym">,&nbsp;</span><span class="src-var">$plugin_method_name</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a376"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;collect&nbsp;informations&nbsp;about&nbsp;request</span></div></li>
<li><div class="src-line"><a name="a378"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'develop_mode'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a379"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_Registry_ref&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Registry.html">Psa_Registry</a></span><span class="src-sym">::</span><a href="../psa/Psa_Registry.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a380"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_Registry_ref</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'executed_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$plugin_class</span><span class="src-sym">,&nbsp;</span><span class="src-var">$plugin_method_name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$plugin_method_args</span><span class="src-sym">,&nbsp;</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$plugin_class</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'type'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$psa_plugins__plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$plugin_class</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-str">'res_before'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a381"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a383"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;profile&nbsp;log&nbsp;is&nbsp;enabled</span></div></li>
<li><div class="src-line"><a name="a384"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'profile_log'</span><span class="src-sym">]&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">!</span>isset<span class="src-sym">(</span>$<span class="src-var">$plugin_class</span><span class="src-sym">-&gt;</span><span class="src-id">psa_no_profile_log</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a385"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$time_start&nbsp;</span>=&nbsp;<a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a386"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$request_id</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a387"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$request_id&nbsp;</span>=&nbsp;<a href="http://www.php.net/uniqid">uniqid</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a388"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a389"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;call&nbsp;plugin&nbsp;method&nbsp;with&nbsp;arguments</span></div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$invoke_method</span><span class="src-sym">-&gt;</span><span class="src-id">invokeArgs</span><span class="src-sym">(</span>$<span class="src-var">$plugin_class</span><span class="src-sym">,&nbsp;</span><span class="src-var">$plugin_method_args</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a393"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;profile&nbsp;log&nbsp;is&nbsp;enabled</span></div></li>
<li><div class="src-line"><a name="a394"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'profile_log'</span><span class="src-sym">]&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">!</span>isset<span class="src-sym">(</span>$<span class="src-var">$plugin_class</span><span class="src-sym">-&gt;</span><span class="src-id">psa_no_profile_log</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a395"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'method'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$plugin_class&nbsp;</span>.&nbsp;<span class="src-str">'-&gt;'&nbsp;</span>.&nbsp;<span class="src-var">$plugin_method_name</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a396"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'total_time'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)&nbsp;</span>-&nbsp;<span class="src-var">$time_start</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a397"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'method_arguments'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$plugin_method_args</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a398"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$log_data</span><span class="src-sym">[</span><span class="src-str">'request_id'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$request_id</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a399"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">Psa_Profile_Logger</span><span class="src-sym">::</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><a href="http://www.php.net/log">log</a><span class="src-sym">(</span><span class="src-var">$log_data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a400"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a401"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a402"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;collect&nbsp;informations&nbsp;about&nbsp;request&nbsp;-&nbsp;I&nbsp;want&nbsp;Psa_Result&nbsp;after&nbsp;executing&nbsp;plugin&nbsp;method</span></div></li>
<li><div class="src-line"><a name="a403"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'develop_mode'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a404"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_executed_plugins_num&nbsp;</span>=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$temp_Registry_ref</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'executed_plugins'</span><span class="src-sym">]</span><span class="src-sym">)</span>-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a405"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_Registry_ref</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'executed_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$temp_executed_plugins_num</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]&nbsp;</span>=&nbsp;<a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a406"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$temp_Registry_ref</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'executed_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$temp_executed_plugins_num</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a407"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a408"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a409"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a410"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$disable_unregistered_exception</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a411"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-str">'Psa_Exception.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/exceptions/Psa_Exception.html">Psa_Exception</a></span><span class="src-sym">(</span><span class="src-str">&quot;</span><span class="src-str">Trying&nbsp;to&nbsp;run&nbsp;unexisting&nbsp;plugin&nbsp;method&nbsp;<span class="src-var">$plugin_class</span>::<span class="src-var">$plugin_method_name</span></span><span class="src-str">&quot;</span><span class="src-sym">,&nbsp;</span><span class="src-num">14</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a414"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a415"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return&nbsp;</span>=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a416"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a417"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a418"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a419"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a420"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a421"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a422"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a423"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a424"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a426"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a427"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;function&nbsp;is&nbsp;registered&nbsp;with&nbsp;PHP&nbsp;spl_autoload_register()&nbsp;function&nbsp;as&nbsp;__autoload()&nbsp;implementation</span></div></li>
<li><div class="src-line"><a name="a428"></a><span class="src-doc">&nbsp;*&nbsp;used&nbsp;to&nbsp;auto&nbsp;include&nbsp;files&nbsp;with&nbsp;PSA&nbsp;plugin&nbsp;classes&nbsp;or&nbsp;your&nbsp;plugins.</span></div></li>
<li><div class="src-line"><a name="a429"></a><span class="src-doc">&nbsp;*&nbsp;Thus&nbsp;you&nbsp;don't&nbsp;have&nbsp;to&nbsp;put&nbsp;&lt;kbd&gt;include()&lt;/kbd&gt;&nbsp;call&nbsp;to&nbsp;include&nbsp;file&nbsp;with&nbsp;&lt;i&gt;Psa_Plugin_&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a430"></a><span class="src-doc">&nbsp;*&nbsp;abstract&nbsp;class&nbsp;in&nbsp;every&nbsp;your&nbsp;plugin&nbsp;file&nbsp;before&nbsp;you&nbsp;extend&nbsp;some&nbsp;&lt;i&gt;Psa_Plugin_&lt;/i&gt;&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a431"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a432"></a><span class="src-doc">&nbsp;*&nbsp;Also&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;call&nbsp;a&nbsp;method&nbsp;from&nbsp;some&nbsp;another&nbsp;plugin&nbsp;class,&nbsp;or&nbsp;extend&nbsp;some&nbsp;plugin&nbsp;class,</span></div></li>
<li><div class="src-line"><a name="a433"></a><span class="src-doc">&nbsp;*&nbsp;you&nbsp;don't&nbsp;have&nbsp;to&nbsp;include&nbsp;its&nbsp;file.</span></div></li>
<li><div class="src-line"><a name="a434"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a435"></a><span class="src-doc">&nbsp;*&nbsp;For&nbsp;example,&nbsp;you&nbsp;can&nbsp;just&nbsp;write:</span></div></li>
<li><div class="src-line"><a name="a436"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a437"></a><span class="src-doc">&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a438"></a><span class="src-doc">&nbsp;*&nbsp;class&nbsp;Default_Controller&nbsp;extends&nbsp;Psa_Plugin_Controller{</span></div></li>
<li><div class="src-line"><a name="a439"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;psa_main(){</span></div></li>
<li><div class="src-line"><a name="a440"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;...&nbsp;something&nbsp;here</span></div></li>
<li><div class="src-line"><a name="a441"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a442"></a><span class="src-doc">&nbsp;*&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a443"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a444"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a445"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a446"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_autoload">psa_autoload</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a447"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a448"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;config&nbsp;array</span></div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_plugins&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Plugin.html">Psa_Plugin</a></span><span class="src-sym">::</span><a href="../psa/Psa_Plugin.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;first&nbsp;try&nbsp;to&nbsp;include&nbsp;class&nbsp;of&nbsp;PSA&nbsp;plugin&nbsp;type</span></div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-num">11</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'Psa_Plugin_'</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;plugin&nbsp;data&nbsp;is&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_psa_plugin_types'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_psa_plugin_types'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$class_name</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a461"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a462"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'plugin_types'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$plugin_type_folder</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a463"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$include_file&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'basedir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-var">$plugin_type_folder&nbsp;</span>.&nbsp;<span class="src-str">'/'&nbsp;</span>.&nbsp;<span class="src-var">$class_name&nbsp;</span>.&nbsp;<span class="src-str">'.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a464"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_file">is_file</a><span class="src-sym">(</span><span class="src-var">$include_file</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a465"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-var">$include_file</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a466"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a467"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a468"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a469"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a470"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a471"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;then&nbsp;try&nbsp;to&nbsp;include&nbsp;registered&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a472"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data&nbsp;</span>&amp;&amp;&nbsp;<a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a473"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-var">$psa_plugins</span><span class="src-sym">-&gt;</span><span class="src-id">plugins_data</span><span class="src-sym">[</span><span class="src-str">'all_plugins'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$class_name</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'file'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a474"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a475"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a476"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a479"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a480"></a><span class="src-doc">&nbsp;*&nbsp;I&nbsp;use&nbsp;this&nbsp;function&nbsp;instead&nbsp;of&nbsp;echo()&nbsp;or&nbsp;print_r()&nbsp;functions&nbsp;during&nbsp;development.</span></div></li>
<li><div class="src-line"><a name="a481"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a482"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$str&nbsp;</span></div></li>
<li><div class="src-line"><a name="a483"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$return_only&nbsp;</span></div></li>
<li><div class="src-line"><a name="a484"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a485"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a486"></a><span class="src-key">function&nbsp;</span><span class="src-id">prs</span><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-var">$return_only&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a487"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return&nbsp;</span>=&nbsp;<span class="src-str">'&lt;pre&gt;'&nbsp;</span>.&nbsp;<a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/print_r">print_r</a><span class="src-sym">(</span><span class="src-var">$str</span><span class="src-sym">,&nbsp;</span><span class="src-id">TRUE</span><span class="src-sym">))&nbsp;</span>.&nbsp;<span class="src-str">'&lt;pre&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a488"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a489"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$return_only</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a490"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a491"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a492"></a>&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-var">$return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a493"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/flush">flush</a>&nbsp;<span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a494"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a495"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a496"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a497"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a498"></a><span class="src-doc">&nbsp;*&nbsp;Returns&nbsp;array&nbsp;with&nbsp;parts&nbsp;of&nbsp;sql&nbsp;query&nbsp;used&nbsp;to&nbsp;store&nbsp;and&nbsp;retrive&nbsp;data&nbsp;from&nbsp;custom&nbsp;database&nbsp;table&nbsp;columns.</span></div></li>
<li><div class="src-line"><a name="a499"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;is&nbsp;helper&nbsp;function&nbsp;used&nbsp;in&nbsp;Psa_User&nbsp;and&nbsp;Psa_Group&nbsp;objects.</span></div></li>
<li><div class="src-line"><a name="a500"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a501"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">$type&nbsp;</span><span class="src-doc">int&nbsp;1-for&nbsp;UPDATE&nbsp;query,&nbsp;2-for&nbsp;INSERT&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a502"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">$data&nbsp;</span><span class="src-doc">array&nbsp;data&nbsp;for&nbsp;the&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a503"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">object&nbsp;</span><span class="src-doc-var">$ignore_unseted&nbsp;</span><span class="src-doc">if&nbsp;property&nbsp;does&nbsp;not&nbsp;exists&nbsp;inside&nbsp;$ignore_unseted&nbsp;object&nbsp;do&nbsp;not&nbsp;include&nbsp;it&nbsp;result&nbsp;arrays</span></div></li>
<li><div class="src-line"><a name="a504"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$changed_properties&nbsp;</span><span class="src-doc">array&nbsp;with&nbsp;indexes&nbsp;same&nbsp;as&nbsp;those&nbsp;in&nbsp;$data&nbsp;array&nbsp;that&nbsp;you&nbsp;want&nbsp;to&nbsp;include&nbsp;in&nbsp;results</span></div></li>
<li><div class="src-line"><a name="a505"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a506"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
<li><div class="src-line"><a name="a507"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a508"></a><span class="src-key">function&nbsp;</span><span class="src-id">psa_orm_make_query_parts</span><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,&nbsp;</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a509"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a510"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'insert_query_columns'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a511"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'insert_query_values'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a512"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'update_query_set'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a513"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'values'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a514"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a515"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/sizeof">sizeof</a><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">))</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a516"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a517"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;global&nbsp;database&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a518"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a519"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a520"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$data&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$data_key&nbsp;</span>=&gt;&nbsp;<span class="src-var">$data_value</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a521"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a522"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;UPDATE&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a523"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$type&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'update_query_set'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">',&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$data_key&nbsp;</span>.&nbsp;<span class="src-str">&quot;&nbsp;=&nbsp;?&quot;</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a525"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a526"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;INSERT&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a527"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$type&nbsp;</span>==&nbsp;<span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a528"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'insert_query_columns'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">,&nbsp;<span class="src-var">$data_key</span></span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a529"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'insert_query_values'</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-str">',&nbsp;?'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a530"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a531"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a532"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$return</span><span class="src-sym">[</span><span class="src-str">'values'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$data_value</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a533"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a534"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a535"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a536"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a537"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a538"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a539"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a540"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a541"></a><span class="src-doc">&nbsp;*&nbsp;Checks&nbsp;if&nbsp;user&nbsp;is&nbsp;a&nbsp;member&nbsp;of&nbsp;a&nbsp;group.</span></div></li>
<li><div class="src-line"><a name="a542"></a><span class="src-doc">&nbsp;*&nbsp;It&nbsp;simply&nbsp;tries&nbsp;to&nbsp;find&nbsp;a&nbsp;matching&nbsp;row&nbsp;in&nbsp;&lt;i&gt;psa_user_in_group&lt;/i&gt;&nbsp;database&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a543"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a544"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc-var">$user&nbsp;</span><span class="src-doc">user&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a545"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc-var">$group&nbsp;</span><span class="src-doc">group&nbsp;id</span></div></li>
<li><div class="src-line"><a name="a546"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">1-user&nbsp;is&nbsp;a&nbsp;member&nbsp;of&nbsp;the&nbsp;group,&nbsp;otherwise&nbsp;0</span></div></li>
<li><div class="src-line"><a name="a547"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a548"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_is_user_in_group">psa_is_user_in_group</a><span class="src-sym">(</span><span class="src-var">$user</span><span class="src-sym">,&nbsp;</span><span class="src-var">$group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a549"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a550"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">,&nbsp;</span><span class="src-var">$psa_database</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a551"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a552"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$user&nbsp;</span>=&nbsp;(int)<span class="src-var">$user</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a553"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;(int)<span class="src-var">$group</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a554"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a555"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$user&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$group</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a556"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a557"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sql&nbsp;</span>=&nbsp;<span class="src-str">&quot;</span><span class="src-str">SELECT&nbsp;*&nbsp;FROM&nbsp;{<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'database'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'table'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'user_in_group'</span><span class="src-sym">]</span><span class="src-sym">}</span>&nbsp;WHERE&nbsp;user_id&nbsp;=&nbsp;'<span class="src-var">$user</span>'&nbsp;AND&nbsp;group_id&nbsp;=&nbsp;'<span class="src-var">$group</span>'</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a558"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">query</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a559"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a560"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$row&nbsp;</span>=&nbsp;<span class="src-var">$psa_database</span><span class="src-sym">-&gt;</span><span class="src-id">fetch_row</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a561"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a562"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-str">'user_id'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a563"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a564"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a565"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a566"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a567"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a568"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a569"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a570"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a571"></a><span class="src-doc">&nbsp;*&nbsp;Returns&nbsp;HTML&nbsp;code&nbsp;with&nbsp;request&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a572"></a><span class="src-doc">&nbsp;*&nbsp;Request&nbsp;information&nbsp;can&nbsp;be&nbsp;nicely&nbsp;shown&nbsp;on&nbsp;the&nbsp;web&nbsp;page&nbsp;you&nbsp;develop&nbsp;by&nbsp;including</span></div></li>
<li><div class="src-line"><a name="a573"></a><span class="src-doc">&nbsp;*&nbsp;html&nbsp;code&nbsp;returned&nbsp;by&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a574"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;can&nbsp;put&nbsp;HTML&nbsp;returned&nbsp;somewhere&nbsp;on&nbsp;the&nbsp;web&nbsp;pages&nbsp;and&nbsp;see&nbsp;information&nbsp;like</span></div></li>
<li><div class="src-line"><a name="a575"></a><span class="src-doc">&nbsp;*&nbsp;all&nbsp;plugins&nbsp;that&nbsp;are&nbsp;called,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Result}</span><span class="src-doc">&nbsp;object,&nbsp;$_GET,&nbsp;$_POST,&nbsp;$_SESSION,</span></div></li>
<li><div class="src-line"><a name="a576"></a><span class="src-doc">&nbsp;*&nbsp;plugin&nbsp;methods&nbsp;arguments...&nbsp;That&nbsp;can&nbsp;be&nbsp;very&nbsp;useful&nbsp;while&nbsp;developing&nbsp;and&nbsp;debugging.</span></div></li>
<li><div class="src-line"><a name="a577"></a><span class="src-doc">&nbsp;*&nbsp;See&nbsp;example&nbsp;</span><span class="src-doc-inlinetag">{@tutorial&nbsp;psa_features.pkg#requestinfo&nbsp;here}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a578"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a579"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;template&nbsp;file&nbsp;this&nbsp;function&nbsp;expects&nbsp;is&nbsp;&lt;i&gt;psa_request_info.tpl&lt;/i&gt;&nbsp;and&nbsp;it&nbsp;is</span></div></li>
<li><div class="src-line"><a name="a580"></a><span class="src-doc">&nbsp;*&nbsp;by&nbsp;default&nbsp;in&nbsp;PSA&nbsp;main&nbsp;directory.&nbsp;Develop&nbsp;mode&nbsp;must&nbsp;be&nbsp;on&nbsp;to&nbsp;enable&nbsp;collecting&nbsp;request</span></div></li>
<li><div class="src-line"><a name="a581"></a><span class="src-doc">&nbsp;*&nbsp;information.&nbsp;You&nbsp;can&nbsp;enable&nbsp;it&nbsp;through&nbsp;main&nbsp;settings&nbsp;in&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;config.php}</span><span class="src-doc">&nbsp;file.</span></div></li>
<li><div class="src-line"><a name="a582"></a><span class="src-doc">&nbsp;*&nbsp;Actually&nbsp;request&nbsp;information&nbsp;is&nbsp;saved&nbsp;in&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Registry}</span><span class="src-doc">&nbsp;object&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a583"></a><span class="src-doc">&nbsp;*&nbsp;&lt;kbd&gt;psa_request_info&lt;/kbd&gt;&nbsp;member&nbsp;array&nbsp;and&nbsp;this&nbsp;function&nbsp;is&nbsp;reading&nbsp;it&nbsp;form&nbsp;there.</span></div></li>
<li><div class="src-line"><a name="a584"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a585"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$tpl_folder&nbsp;</span><span class="src-doc">folder&nbsp;where&nbsp;is&nbsp;&lt;i&gt;psa_request_info.tpl&lt;/i&gt;&nbsp;template&nbsp;file.</span></div></li>
<li><div class="src-line"><a name="a586"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;If&nbsp;not&nbsp;set&nbsp;PSA&nbsp;main&nbsp;folder&nbsp;is&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a587"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">bool</span><span class="src-doc">|</span><span class="src-doc-type">string</span><span class="src-doc">rendered&nbsp;template&nbsp;-&nbsp;HTML&nbsp;code,&nbsp;false&nbsp;if&nbsp;develop&nbsp;mode&nbsp;is&nbsp;not&nbsp;on.</span></div></li>
<li><div class="src-line"><a name="a588"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a589"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_request_info_html">psa_request_info_html</a><span class="src-sym">(</span><span class="src-var">$tpl_folder&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a590"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a591"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">global&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a592"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a593"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;return&nbsp;if&nbsp;develop&nbsp;mode&nbsp;is&nbsp;disabled</span></div></li>
<li><div class="src-line"><a name="a594"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'develop_mode'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a595"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a596"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a597"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;include&nbsp;Psa_Dully&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include_once&nbsp;</span><span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'basedir'</span><span class="src-sym">]&nbsp;</span>.&nbsp;<span class="src-str">'/scripts/Psa_Dully.class.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a600"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;new&nbsp;Psa_Dully&nbsp;template&nbsp;engine&nbsp;object</span></div></li>
<li><div class="src-line"><a name="a601"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psa/Psa_Dully.html">Psa_Dully</a></span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a602"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a603"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;folder&nbsp;with&nbsp;templates</span></div></li>
<li><div class="src-line"><a name="a604"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$tpl_folder</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a605"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tpl_folder&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">[</span><span class="src-str">'folders'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'basedir'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a606"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">template_dir&nbsp;</span>=&nbsp;<span class="src-var">$tpl_folder</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a607"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a608"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$registry&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Registry.html">Psa_Registry</a></span><span class="src-sym">::</span><a href="../psa/Psa_Registry.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a609"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a610"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$psa_result'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a611"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a612"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a613"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$_GET'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'globals'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'_GET'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$_POST'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a617"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'globals'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'_POST'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a619"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$_SESSION'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a620"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'globals'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'_SESSION'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a621"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a622"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$_COOKIE'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a623"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">5</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'globals'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'_COOKIE'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a624"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a625"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$_SERVER'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a626"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">6</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'globals'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'_SERVER'</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a627"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a628"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">7</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'$PSA_CFG'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a629"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">7</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$PSA_CFG</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a630"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a631"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;hide&nbsp;database&nbsp;password</span></div></li>
<li><div class="src-line"><a name="a632"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">7</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pdo'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'password'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'xxxxx'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a633"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a634"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'menu_text'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-str">'Psa_Plugin'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a635"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$objects</span><span class="src-sym">[</span><span class="src-num">8</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'content'</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Plugin.html">Psa_Plugin</a></span><span class="src-sym">::</span><a href="../psa/Psa_Plugin.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a636"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a637"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">'executed_plugins'</span><span class="src-sym">,</span><span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'executed_plugins'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a638"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">'objects'</span><span class="src-sym">,</span><span class="src-var">$objects</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a639"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">'log'</span><span class="src-sym">,</span><span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'log'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'psa_default'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a640"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">assign</span><span class="src-sym">(</span><span class="src-str">'log_profile'</span><span class="src-sym">,</span><span class="src-sym">@</span><span class="src-var">$registry</span><span class="src-sym">-&gt;</span><span class="src-id">psa_request_info</span><span class="src-sym">[</span><span class="src-str">'log'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'psa_profile'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a641"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a642"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$dully</span><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-str">'psa_request_info.tpl'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a643"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a644"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a645"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a646"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a647"></a><span class="src-doc">&nbsp;*&nbsp;Adds&nbsp;given&nbsp;path&nbsp;to&nbsp;PHP&nbsp;include_path&nbsp;configuration&nbsp;directive.</span></div></li>
<li><div class="src-line"><a name="a648"></a><span class="src-doc">&nbsp;*&nbsp;It&nbsp;can&nbsp;be&nbsp;useful&nbsp;when&nbsp;you&nbsp;work&nbsp;with&nbsp;some&nbsp;externals&nbsp;libraries&nbsp;like&nbsp;Zend&nbsp;Framework.</span></div></li>
<li><div class="src-line"><a name="a649"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a650"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$path&nbsp;</span><span class="src-doc">path&nbsp;to&nbsp;add&nbsp;to&nbsp;include&nbsp;path</span></div></li>
<li><div class="src-line"><a name="a651"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">bool</span><span class="src-doc">returns&nbsp;the&nbsp;old&nbsp;include_path&nbsp;on&nbsp;success&nbsp;or&nbsp;FALSE&nbsp;on&nbsp;failure.</span></div></li>
<li><div class="src-line"><a name="a652"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;http://www.php.net/manual/en/ini.core.php#ini.include-path</span></div></li>
<li><div class="src-line"><a name="a653"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a654"></a><span class="src-key">function&nbsp;</span><a href="../psa/_scripts---functions.php.html#functionpsa_add_include_path">psa_add_include_path</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a655"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a656"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a657"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/set_include_path">set_include_path</a><span class="src-sym">(</span><a href="http://www.php.net/get_include_path">get_include_path</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-id">PATH_SEPARATOR&nbsp;</span>.&nbsp;<span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a658"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a659"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a660"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a661"></a><span class="src-sym">}</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:49 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</body>
</html>